import {createRouter ,createWebHistory,RouteRecordRaw} from 'vue-router'


let routes:any=[
  {
    path:"/",
    redirect:"/login"
  },
  {
    path:"/login",
    name:"login",
    component:()=>import("../views/login/index.vue"),
    meta:{
      title:"登录"
    }
  },
   {
    path:"/layout",
    name:"layout",
    component:()=>import("../layout/index.vue"),
    children:[
        {
          path:"/",
          redirect:"/home"
        },
       {
          path:"home",
          name:'home',
          component:()=>import("../views/home/index.vue")
        },
         {
          path:"admin",
          name:'admin',
          component:()=>import("../views/admin/index.vue")
        },
        {
          path:"student",
          name:'student',
          component:()=>import("../views/student/index.vue")
        },
        {
          path:"video",
          name:'video',
          component:()=>import("../views/video/index.vue")
        },
        { //课程添加
          path:"courseadd",
          name:'courseadd',
          component:()=>import("../views/courseAdd/index.vue")
        },
          { //课程列表
          path:"courselist",
          name:'courselist',
          component:()=>import("../views/courseList/index.vue")
        },
    ]
  },
]

let router=createRouter({
  history:createWebHistory(),
  routes
})

export default router